const app = getApp();
const request = require('../../utils/request.js');
Component({
  options: {
    addGlobalClass: true,
  },
  data: {
    lists: [],
    categoryData:[]
  },
  methods:{
  zilizhang: function (event) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:32 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/zilizhang/zlz',
    });
  },
  bmi: function (event) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:30 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/bmi/bmi',
    });
  },
  jinianri: function (event) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:31 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/jinianri/jinianri',
    });
  },
  tallyBook:function(e){
    wx.navigateTo({
      url: '../welfare/tally-book/tally-book',
    })
  },
  constellation: function (e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:5 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
      console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/constellation/constellation',
    })
  },
  news:function(){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:33 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/news/news',
    })
  },
  memo: function (e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:34 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/memo/memo',
    })
  },
  morse: function (e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:35 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/morse/morse',
    })
  },
  huoxing: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:36 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/huoxing/huoxing',
    })
  },
  led: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:37 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/led/led',
    })
  },
  rule: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:38 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/rule/rule',
    })
  },
  draw: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:39 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/draw/draw',
    })
  },
  radix: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:40 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/radix/radix',
    })
  },
  datecalc: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:41 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/datecalc/datecalc',
    })
  },
  random: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:42 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/random/random',
    })
  },
  rmb: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:43 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/rmb/rmb',
    })
  },
  bizi: function(e) {
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:44 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/bizi/bizi',
    })
  },
  duanshipin: function(e) {
          //初始化次数及信息
          var urlContent = app.globalData.url + "toolapi/tModule/update"
          var params={ id:4 }
          request.requestPostApi(urlContent, params, this, null, function (res) {
            console.error(res)
          })
    wx.navigateTo({
      url: '../../pages/resolution/resolution',
    })
   },
   choujiang: function(e) {
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:45 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/choujiang/choujiang',
    })
   },
   xiaohua: function(e) {
      //初始化次数及信息
        var urlContent = app.globalData.url + "toolapi/tModule/update"
        var params={ id:27 }
        request.requestPostApi(urlContent, params, this, null, function (res) {
            console.error(res)
        })
    wx.navigateTo({
      url: '../welfare/joke/joke',
    })
   },
   danmu: function(e) {
     //初始化次数及信息
     var urlContent = app.globalData.url + "toolapi/tModule/update"
     var params={ id:28 }
     request.requestPostApi(urlContent, params, this, null, function (res) {
         console.error(res)
     })
    wx.navigateTo({
      url: '../welfare/subtitle/subtitle',
    })
   },
   erweima: function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:29 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/erweima/erweima',
    })
   },
   card: function(e){
    wx.navigateTo({
      url: '../welfare/card/card',
    })
   },
   douyin: function(e){
      //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:3 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
      })
    wx.navigateTo({
      url: '../welfare/douyin/douyin',
    })

   },
   tianqi: function(e){
          //初始化次数及信息
          var urlContent = app.globalData.url + "toolapi/tModule/update"
          var params={ id:6 }
          request.requestPostApi(urlContent, params, this, null, function (res) {
            console.error(res)
          })
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:3 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
      })
    wx.navigateTo({
      url: '../../pages/welfare/tianqi/tianqi',
    })
   },
   guajian: function(e){
           //初始化次数及信息
           var urlContent = app.globalData.url + "toolapi/tModule/update"
           var params={ id:7 }
           request.requestPostApi(urlContent, params, this, null, function (res) {
             console.error(res)
           })
    wx.navigateTo({
     url: '../welfare/pendant/pendant'
    })
   },
   qingshi: function(e){
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:8 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/qingshi/qingshi'
    })
   },
   lianai: function(e){
      //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:9 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/lianai/lianai'
    })
   },
   mingren: function(e){
      //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:10 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
          console.error(res)
      })
    wx.navigateTo({
     url: '../welfare/mingren/mingren'
    })
   },
   tuwen: function(e){
     //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:11 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
          console.error(res)
      })
    wx.navigateTo({
     url: '../welfare/tuwen/tuwen'
    })
   },
   pyq: function(e){
     //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:12 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
          console.error(res)
      })
    wx.navigateTo({
     url: '../welfare/pyq/pyq'
    })
   },
   taici:function(e){
     //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:13 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
          console.error(res)
      })
    wx.navigateTo({
     url: '../welfare/taici/taici'
    })
   },
   duilian:function(e){
          //初始化次数及信息
          var urlContent = app.globalData.url + "toolapi/tModule/update"
          var params={ id:14 }
          request.requestPostApi(urlContent, params, this, null, function (res) {
              console.error(res)
          })
    wx.navigateTo({
     url: '../welfare/duilian/duilian'
    })
   },
   xiaoduanzhi:function(e){
       //初始化次数及信息
       var urlContent = app.globalData.url + "toolapi/tModule/update"
       var params={ id:15 }
       request.requestPostApi(urlContent, params, this, null, function (res) {
           console.error(res)
       })
    wx.navigateTo({
     url: '../welfare/xiaoduanzhi/xiaoduanzhi'
    })
   },
   tiangou:function(e){
      //初始化次数及信息
      var urlContent = app.globalData.url + "toolapi/tModule/update"
      var params={ id:16 }
      request.requestPostApi(urlContent, params, this, null, function (res) {
          console.error(res)
      })
    wx.navigateTo({
     url: '../welfare/tiangou/tiangou'
    })
   },
   yingyu:function(e){
     //初始化次数及信息
     var urlContent = app.globalData.url + "toolapi/tModule/update"
     var params={ id:17 }
     request.requestPostApi(urlContent, params, this, null, function (res) {
         console.error(res)
     })
    wx.navigateTo({
     url: '../welfare/yingyu/yingyu'
    })
   },
   xingshi:function(e){
     //初始化次数及信息
     var urlContent = app.globalData.url + "toolapi/tModule/update"
     var params={ id:18 }
     request.requestPostApi(urlContent, params, this, null, function (res) {
         console.error(res)
     })
    wx.navigateTo({
     url: '../welfare/xingshi/xingshi'
    })
   },
   zaoan:function(e){
     //初始化次数及信息
     var urlContent = app.globalData.url + "toolapi/tModule/update"
     var params={ id:19 }
     request.requestPostApi(urlContent, params, this, null, function (res) {
         console.error(res)
     })
    wx.navigateTo({
     url: '../welfare/zaoan/zaoan'
    })
   },
   wanan:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:20 }
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/wanans/wanans'
    })
   },
   youmei:function(e){
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:21}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/youmei/youmei'
    })
   },
   lizhi:function(e){
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:22}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/lizhi/lizhi'
    })
   },
   dujitang:function(e){
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:23}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/dujitang/dujitang'
    })
   },
   chp:function(e){
     //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:24}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/chp/chp'
    })
   },
   minguo:function(e){
      //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:25}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/minguo/minguo'
    })
   },
   songci:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:26}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
     url: '../welfare/songci/songci'
    })
   },
   yinyue:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:47}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/yinyue/yinyue'
     })
   },
   xinkeiren:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:48}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/xinkeiren/xinkeiren'
     })
   },
   mingyanjingyu:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:49}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/mingyanjingyu/mingyanjingyu'
     })
   },
   thisjintian:function(e){
        //初始化次数及信息
        var urlContent = app.globalData.url + "toolapi/tModule/update"
        var params={ id:50}
        request.requestPostApi(urlContent, params, this, null, function (res) {
            console.error(res)
        })
    wx.navigateTo({
      url: '../welfare/thisjintian/thisjintian'
     })
   },
   yizhan:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:51}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/yizhan/yizhan'
     })
   },
   jingmeijuz:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:52}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/jingmeijuz/jingmeijuz'
     })
   },
   xiehuiyu:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:53}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/xiehuiyu/xiehuiyu'
     })
   },
   shenhuifu:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:54}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/shenhuifu/shenhuifu'
     })
   },
   raokoulin:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:55}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/raokoulin/raokoulin'
     })
   },
   jianshuolishi:function(e){
    //初始化次数及信息
    var urlContent = app.globalData.url + "toolapi/tModule/update"
    var params={ id:56}
    request.requestPostApi(urlContent, params, this, null, function (res) {
        console.error(res)
    })
    wx.navigateTo({
      url: '../welfare/jianshuolishi/jianshuolishi'
     })
   },
   updateUser(e){
    var urlContent = app.globalData.url + "api/wx/update"
    var params = {
      name: e
    };
    request.requestPostApi(urlContent, params, this, function (res) {
      if (res.status == 200) {
      }
    })
  }
  },
  lifetimes: {
    created: function(){
      let thas = this
      var params={
      }
      var urlContent = app.globalData.url + "toolapi/tModule/list"
      request.requestPostApi(urlContent,params,this,function(res){
        if(res.status==200){
          thas.setData({
            lists: res.data
        })
        var url = app.globalData.url + "api/wx/login"
        request.requestPostApi(url,{},this,function(e){
          if(res.status==200){
            console.log("百宝箱获取信息！！")
          }
        })
        var urlww = app.globalData.url + "api/wx/getName"
        var params = {
          memCard: wx.getStorageSync('openId')
        };
        request.requestGetApi(urlww, params, this, function (res) {
          if(res.status!=200){
          wx.getUserProfile({
          desc: '用于展示用户信息',
          success(res) {
            var user = res.userInfo
            app.globalData.userInfo = user
            thas.setData({
              userInfo: user
            }),
            thas.updateUser(user.nickName)
          }
        })
          }
        })
        }
      })
    }
  },
});